package com.ydd.mqserver.controller;

import com.ydd.mqserver.mq.producer.RabbitmqProducer;
import com.ydd.mqserver.vo.NotifyMsgSendVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.UUID;
@RestController
@Slf4j
public class TestController {

    @Resource
    private RabbitmqProducer rabbitmqProducer;

    @GetMapping("/openApi")
    public String produce() {
        NotifyMsgSendVO vo = new NotifyMsgSendVO();
        String s = UUID.randomUUID().toString();
        vo.setPriKey(s);
        vo.setPhoneNum("191xxxxxxxx");
        vo.setBusinessType("msg_send");
        log.info(s);
        rabbitmqProducer.send(vo);
        return "success";
    }
}
